home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / cgbsvx.z / cgbsvx
Encoding:
Text File  |  2002-10-03  |  14.8 KB  |  397 lines

  1.  
  2.  
  3.  
  4. CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CGBSVX - use the LU factorization to compute the solution to a complex
  10.      system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE CGBSVX( FACT, TRANS, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB,
  14.                         IPIV, EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR,
  15.                         WORK, RWORK, INFO )
  16.  
  17.          CHARACTER      EQUED, FACT, TRANS
  18.  
  19.          INTEGER        INFO, KL, KU, LDAB, LDAFB, LDB, LDX, N, NRHS
  20.  
  21.          REAL           RCOND
  22.  
  23.          INTEGER        IPIV( * )
  24.  
  25.          REAL           BERR( * ), C( * ), FERR( * ), R( * ), RWORK( * )
  26.  
  27.          COMPLEX        AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), WORK( *
  28.                         ), X( LDX, * )
  29.  
  30. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  31.      These routines are part of the SCSL Scientific Library and can be loaded
  32.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  33.      directs the linker to use the multi-processor version of the library.
  34.  
  35.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  36.      4 bytes (32 bits). Another version of SCSL is available in which integers
  37.      are 8 bytes (64 bits).  This version allows the user access to larger
  38.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  39.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  40.      only one of the two versions; 4-byte integer and 8-byte integer library
  41.      calls cannot be mixed.
  42.  
  43. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  44.      CGBSVX uses the LU factorization to compute the solution to a complex
  45.      system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
  46.      where A is a band matrix of order N with KL subdiagonals and KU
  47.      superdiagonals, and X and B are N-by-NRHS matrices.
  48.  
  49.      Error bounds on the solution and a condition estimate are also provided.
  50.  
  51.  
  52. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  53.      The following steps are performed by this subroutine:
  54.  
  55.      1. If FACT = 'E', real scaling factors are computed to equilibrate
  56.         the system:
  57.            TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
  58.            TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
  59.            TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  71.  
  72.  
  73.  
  74.         Whether or not the system will be equilibrated depends on the
  75.         scaling of the matrix A, but if equilibration is used, A is
  76.         overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
  77.         or diag(C)*B (if TRANS = 'T' or 'C').
  78.  
  79.      2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
  80.         matrix A (after equilibration if FACT = 'E') as
  81.            A = L * U,
  82.         where L is a product of permutation and unit lower triangular
  83.         matrices with KL subdiagonals, and U is upper triangular with
  84.         KL+KU superdiagonals.
  85.  
  86.      3. If some U(i,i)=0, so that U is exactly singular, then the routine
  87.         returns with INFO = i. Otherwise, the factored form of A is used
  88.         to estimate the condition number of the matrix A.  If the
  89.         reciprocal of the condition number is less than machine precision,
  90.         INFO = N+1 is returned as a warning, but the routine still goes on
  91.         to solve for X and compute error bounds as described below.
  92.  
  93.      4. The system of equations is solved for X using the factored form
  94.         of A.
  95.  
  96.      5. Iterative refinement is applied to improve the computed solution
  97.         matrix and calculate error bounds and backward error estimates
  98.         for it.
  99.  
  100.      6. If equilibration was used, the matrix X is premultiplied by
  101.         diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
  102.         that it solves the original system before equilibration.
  103.  
  104.  
  105. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  106.      FACT    (input) CHARACTER*1
  107.              Specifies whether or not the factored form of the matrix A is
  108.              supplied on entry, and if not, whether the matrix A should be
  109.              equilibrated before it is factored.  = 'F':  On entry, AFB and
  110.              IPIV contain the factored form of A.  If EQUED is not 'N', the
  111.              matrix A has been equilibrated with scaling factors given by R
  112.              and C.  AB, AFB, and IPIV are not modified.  = 'N':  The matrix A
  113.              will be copied to AFB and factored.
  114.              = 'E':  The matrix A will be equilibrated if necessary, then
  115.              copied to AFB and factored.
  116.  
  117.      TRANS   (input) CHARACTER*1
  118.              Specifies the form of the system of equations.  = 'N':  A * X = B
  119.              (No transpose)
  120.              = 'T':  A**T * X = B  (Transpose)
  121.              = 'C':  A**H * X = B  (Conjugate transpose)
  122.  
  123.      N       (input) INTEGER
  124.              The number of linear equations, i.e., the order of the matrix A.
  125.              N >= 0.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      KL      (input) INTEGER
  141.              The number of subdiagonals within the band of A.  KL >= 0.
  142.  
  143.      KU      (input) INTEGER
  144.              The number of superdiagonals within the band of A.  KU >= 0.
  145.  
  146.      NRHS    (input) INTEGER
  147.              The number of right hand sides, i.e., the number of columns of
  148.              the matrices B and X.  NRHS >= 0.
  149.  
  150.      AB      (input/output) COMPLEX array, dimension (LDAB,N)
  151.              On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
  152.              The j-th column of A is stored in the j-th column of the array AB
  153.              as follows:  AB(KU+1+i-j,j) = A(i,j) for max(1,j-
  154.              KU)<=i<=min(N,j+kl)
  155.  
  156.              If FACT = 'F' and EQUED is not 'N', then A must have been
  157.              equilibrated by the scaling factors in R and/or C.  AB is not
  158.              modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N'
  159.              on exit.
  160.  
  161.              On exit, if EQUED .ne. 'N', A is scaled as follows:  EQUED = 'R':
  162.              A := diag(R) * A
  163.              EQUED = 'C':  A := A * diag(C)
  164.              EQUED = 'B':  A := diag(R) * A * diag(C).
  165.  
  166.      LDAB    (input) INTEGER
  167.              The leading dimension of the array AB.  LDAB >= KL+KU+1.
  168.  
  169.      AFB     (input or output) COMPLEX array, dimension (LDAFB,N)
  170.              If FACT = 'F', then AFB is an input argument and on entry
  171.              contains details of the LU factorization of the band matrix A, as
  172.              computed by CGBTRF.  U is stored as an upper triangular band
  173.              matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the
  174.              multipliers used during the factorization are stored in rows
  175.              KL+KU+2 to 2*KL+KU+1.  If EQUED .ne. 'N', then AFB is the
  176.              factored form of the equilibrated matrix A.
  177.  
  178.              If FACT = 'N', then AFB is an output argument and on exit returns
  179.              details of the LU factorization of A.
  180.  
  181.              If FACT = 'E', then AFB is an output argument and on exit returns
  182.              details of the LU factorization of the equilibrated matrix A (see
  183.              the description of AB for the form of the equilibrated matrix).
  184.  
  185.      LDAFB   (input) INTEGER
  186.              The leading dimension of the array AFB.  LDAFB >= 2*KL+KU+1.
  187.  
  188.      IPIV    (input or output) INTEGER array, dimension (N)
  189.              If FACT = 'F', then IPIV is an input argument and on entry
  190.              contains the pivot indices from the factorization A = L*U as
  191.              computed by CGBTRF; row i of the matrix was interchanged with row
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  203.  
  204.  
  205.  
  206.              IPIV(i).
  207.  
  208.              If FACT = 'N', then IPIV is an output argument and on exit
  209.              contains the pivot indices from the factorization A = L*U of the
  210.              original matrix A.
  211.  
  212.              If FACT = 'E', then IPIV is an output argument and on exit
  213.              contains the pivot indices from the factorization A = L*U of the
  214.              equilibrated matrix A.
  215.  
  216.      EQUED   (input or output) CHARACTER*1
  217.              Specifies the form of equilibration that was done.  = 'N':  No
  218.              equilibration (always true if FACT = 'N').
  219.              = 'R':  Row equilibration, i.e., A has been premultiplied by
  220.              diag(R).  = 'C':  Column equilibration, i.e., A has been
  221.              postmultiplied by diag(C).  = 'B':  Both row and column
  222.              equilibration, i.e., A has been replaced by diag(R) * A *
  223.              diag(C).  EQUED is an input argument if FACT = 'F'; otherwise, it
  224.              is an output argument.
  225.  
  226.      R       (input or output) REAL array, dimension (N)
  227.              The row scale factors for A.  If EQUED = 'R' or 'B', A is
  228.              multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is
  229.              not accessed.  R is an input argument if FACT = 'F'; otherwise, R
  230.              is an output argument.  If FACT = 'F' and EQUED = 'R' or 'B',
  231.              each element of R must be positive.
  232.  
  233.      C       (input or output) REAL array, dimension (N)
  234.              The column scale factors for A.  If EQUED = 'C' or 'B', A is
  235.              multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is
  236.              not accessed.  C is an input argument if FACT = 'F'; otherwise, C
  237.              is an output argument.  If FACT = 'F' and EQUED = 'C' or 'B',
  238.              each element of C must be positive.
  239.  
  240.      B       (input/output) COMPLEX array, dimension (LDB,NRHS)
  241.              On entry, the right hand side matrix B.  On exit, if EQUED = 'N',
  242.              B is not modified; if TRANS = 'N' and EQUED = 'R' or 'B', B is
  243.              overwritten by diag(R)*B; if TRANS = 'T' or 'C' and EQUED = 'C'
  244.              or 'B', B is overwritten by diag(C)*B.
  245.  
  246.      LDB     (input) INTEGER
  247.              The leading dimension of the array B.  LDB >= max(1,N).
  248.  
  249.      X       (output) COMPLEX array, dimension (LDX,NRHS)
  250.              If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to the
  251.              original system of equations.  Note that A and B are modified on
  252.              exit if EQUED .ne. 'N', and the solution to the equilibrated
  253.              system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B',
  254.              or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      LDX     (input) INTEGER
  273.              The leading dimension of the array X.  LDX >= max(1,N).
  274.  
  275.      RCOND   (output) REAL
  276.              The estimate of the reciprocal condition number of the matrix A
  277.              after equilibration (if done).  If RCOND is less than the machine
  278.              precision (in particular, if RCOND = 0), the matrix is singular
  279.              to working precision.  This condition is indicated by a return
  280.              code of INFO > 0.
  281.  
  282.      FERR    (output) REAL array, dimension (NRHS)
  283.              The estimated forward error bound for each solution vector X(j)
  284.              (the j-th column of the solution matrix X).  If XTRUE is the true
  285.              solution corresponding to X(j), FERR(j) is an estimated upper
  286.              bound for the magnitude of the largest element in (X(j) - XTRUE)
  287.              divided by the magnitude of the largest element in X(j).  The
  288.              estimate is as reliable as the estimate for RCOND, and is almost
  289.              always a slight overestimate of the true error.
  290.  
  291.      BERR    (output) REAL array, dimension (NRHS)
  292.              The componentwise relative backward error of each solution vector
  293.              X(j) (i.e., the smallest relative change in any element of A or B
  294.              that makes X(j) an exact solution).
  295.  
  296.      WORK    (workspace) COMPLEX array, dimension (2*N)
  297.  
  298.      RWORK   (workspace/output) REAL array, dimension (N)
  299.              On exit, RWORK(1) contains the reciprocal pivot growth factor
  300.              norm(A)/norm(U). The "max absolute element" norm is used. If
  301.              RWORK(1) is much less than 1, then the stability of the LU
  302.              factorization of the (equilibrated) matrix A could be poor. This
  303.              also means that the solution X, condition estimator RCOND, and
  304.              forward error bound FERR could be unreliable. If factorization
  305.              fails with 0<INFO<=N, then RWORK(1) contains the reciprocal pivot
  306.              growth factor for the leading INFO columns of A.
  307.  
  308.      INFO    (output) INTEGER
  309.              = 0:  successful exit
  310.              < 0:  if INFO = -i, the i-th argument had an illegal value
  311.              > 0:  if INFO = i, and i is
  312.              <= N:  U(i,i) is exactly zero.  The factorization has been
  313.              completed, but the factor U is exactly singular, so the solution
  314.              and error bounds could not be computed. RCOND = 0 is returned.  =
  315.              N+1: U is nonsingular, but RCOND is less than machine precision,
  316.              meaning that the matrix is singular to working precision.
  317.              Nevertheless, the solution and error bounds are computed because
  318.              there are a number of situations where the computed solution can
  319.              be more accurate than the value of RCOND would suggest.
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  335.  
  336.  
  337.  
  338. SEE ALSO
  339.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  340.  
  341.      This man page is available only online.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.